From bdf3abd7199992ad05d34c7b53ee087c9c46bf29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Fri, 14 Mar 2014 19:06:23 +0100 Subject: [PATCH] mediawiki.api.category: Deprecate getCategories() 'async' parameter One should never set it to anything other than the default value. Change-Id: I6d191916f14aa29a04b2190debe9901032629938 --- RELEASE-NOTES-1.23 | 1 + resources/mediawiki.api/mediawiki.api.category.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index cea7f69673..ff7b5f9a67 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -318,6 +318,7 @@ changes to languages because of Bugzilla reports. parser, where it differs from the PHP parser). * Special:Search no longer has an "include redirects" option on the advanced tab. Redirects are now included in all searches. +* mediawiki.api.category's getCategories() 'async' parameter was deprecated. ==== Removed classes ==== * FakeMemCachedClient (deprecated in 1.18) diff --git a/resources/mediawiki.api/mediawiki.api.category.js b/resources/mediawiki.api/mediawiki.api.category.js index 7435e04439..a90617d8ad 100644 --- a/resources/mediawiki.api/mediawiki.api.category.js +++ b/resources/mediawiki.api/mediawiki.api.category.js @@ -21,7 +21,6 @@ titles: String( title ) } ); - // Backwards compatibility (< MW 1.20) if ( ok || err ) { mw.track( 'mw.deprecate', 'api.cbParam' ); mw.log.warn( msg ); @@ -64,7 +63,6 @@ apnamespace: mw.config.get( 'wgNamespaceIds' ).category } ); - // Backwards compatibility (< MW 1.20) if ( ok || err ) { mw.track( 'mw.deprecate', 'api.cbParam' ); mw.log.warn( msg ); @@ -91,7 +89,7 @@ * @param {mw.Title|string} title * @param {Function} [ok] Success callback (deprecated) * @param {Function} [err] Error callback (deprecated) - * @param {boolean} [async=true] Asynchronousness + * @param {boolean} [async=true] Asynchronousness (deprecated) * @return {jQuery.Promise} * @return {Function} return.done * @return {boolean|mw.Title[]} return.done.categories List of category titles or false @@ -105,11 +103,17 @@ async: async === undefined ? true : async } ); - // Backwards compatibility (< MW 1.20) if ( ok || err ) { mw.track( 'mw.deprecate', 'api.cbParam' ); mw.log.warn( msg ); } + if ( async !== undefined ) { + mw.track( 'mw.deprecate', 'api.async' ); + mw.log.warn( + 'Use of mediawiki.api async=false param is deprecated. ' + + 'The sychronous mode will be removed in the future.' + ); + } return apiPromise .then( function ( data ) { -- 2.20.1